package com.huan.kv;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

//TODO KeyValueTextInputFormat 输入的 key 和 value 都是 Text类型的
//TODO 只适合首列数据的显示，（适合文件人名统计），
public class KVTextMapper extends Mapper<Text,Text,Text, IntWritable> {


    IntWritable v = new IntWritable(1);
    @Override
    protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {

//        String[] splits = value.toString().split( " " );
//
//        k.set( splits[0] );

        context.write( key,v );

    }
}
